<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<!-- Standard Head Part -->
<head>
<title>NUnit - RequiredAddin</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-US">
<link rel="stylesheet" type="text/css" href="nunit.css">
<link rel="shortcut icon" href="favicon.ico">
</head>
<!-- End Standard Head Part -->

<body>

<!-- Standard Header for NUnit.org -->
<div id="header">
  <a id="logo" href="http://www.nunit.org"><img src="img/logo.gif" alt="NUnit.org" title="NUnit.org"></a>
  <div id="nav">
    <a href="http://www.nunit.org">NUnit</a>
    <a class="active" href="index.html">Documentation</a>
  </div>
</div>
<!-- End of Header -->

<div id="content">

<h3>RequiredAddinAttribute (NUnit 2.5)</h3>

<div style="text-align: center; margin: 2em 10%; padding: 4px 0; border: 2px solid black">
  <h4>Preliminary documentation, subject to change.</h4>
</div>

<p>The RequiredAddin attribute is used to indicate that a test case, fixture
   or assembly requires a particular addin in order to function correctly. If
   that addin is not installed, the test represented by the method, class or
   assembly on which the addin appears is marked as non-runnable.
   
<p><b>Note:</b> This attribute is of limited utility below the assembly
level, for two reasons:
<ol>
<li>If the method or class is not recognized as a test, due to the addin
being missing, then NUnit will never process it.
<li>If the method or class is handled by some a different addin, that
addin may not recognize the attribute.
</ol>
<p>Depending on user feedback, we may limit the use of this attribute
to the assembly level in the final release of NUnit 2.5.
   
<h4>Example</h4>

<div class="code"><pre>
assembly:RequiredAddin("MyTestFixtureAddin") <-- Always works
assembly:RequiredAddin("MyTestAddin");
assembly:RequiredAddin("MyDecoratorAddin");

namespace NUnit.Tests
{
  using System;
  using NUnit.Framework;

  [MyTestFixture]
  [RequiredAddin("MyTestFixtureAddin")] <-- Won't work
  public class MyTests
  {
    [MyTest]
	[RequiredAddin("MyTestAddin")] <-- This won't either
	public void SomeTest()
	{
	  ...
	}
  }
  
  [TestFixture, MyDecorator]
  [RequiredAddin("MyDecoratorAddin")] <-- This works
  public class MoreTests
  {
    [Test, MyDecorator]
    [RequiredAddin("MyDecoratorAddin")] <-- This too
	public void AnotherTest()
	{
	  ...
	}
  }
}
</pre>
</div>

</div>

<!-- Submenu -->
<div id="subnav">
<ul>
<li><a href="index.html">NUnit 2.5</a></li>
<ul>
<li><a href="getStarted.html">Getting&nbsp;Started</a></li>
<li><a href="assertions.html">Assertions</a></li>
<li><a href="attributes.html">Attributes</a></li>
<ul>
<li><a href="testIdentification.html">Test&nbsp;Identification</a></li>
<li><a href="testSelection.html">Test&nbsp;Selection</a></li>
<li><a href="testModification.html">Test&nbsp;Modification</a></li>
<ul>
<li><a href="exception.html">Expected&nbsp;Exception</a></li>
<li id="current"><a href="requiredAddin.html">Required&nbsp;Addin</a></li>
<li><a href="setCulture.html">SetCulture</a></li>
</ul>
<li><a href="setupTeardown.html">Setup&nbsp;and&nbsp;Teardown</a></li>
<li><a href="parameterizedTests.html">Parameterized&nbsp;Tests</a></li>
</ul>
<li><a href="nunit-console.html">Console&nbsp;Runner</a></li>
<li><a href="nunit-gui.html">Gui&nbsp;Runner</a></li>
<li><a href="features.html">Other&nbsp;Features</a></li>
<li><a href="releaseNotes.html">Release&nbsp;Notes</a></li>
<li><a href="samples.html">Samples</a></li>
<li><a href="license.html">License</a></li>
</ul>
</ul>
</div>
<!-- End of Submenu -->


<!-- Standard Footer for NUnit.org -->
<div id="footer">
  Copyright &copy; 2008 Charlie Poole. All Rights Reserved.
</div>
<!-- End of Footer -->

</body>
</html>
